package com.ts.api.common.redis;

import com.gitee.apanlh.util.base.StringUtils;
import com.gitee.apanlh.util.cache.redis.RedisKeyBuilder;
import com.gitee.apanlh.util.cache.redis.api.RedisString;
import org.springframework.stereotype.Component;

/**
 *  自有渠道分发相关key
 *  撞库唯一id流程
 *  进件申请成功流程
 *
 *  @author Pan
 */
@Component
public class ChannelMatchRedisKey {

    /** 自有渠道-申请成功保存流程 */
    public static final RedisString CHANNEL_APPLY_NOTICE_FLOW = RedisKeyBuilder.builder().withKeys("channel_apply_notice_flow").buildString();

    /**
     *  创建撞库保存唯一id根据phoneMd5
     *
     *  @return String
     */
    public static String getDataExchangeUniqueIdByPhoneMd5(Long productId, Long productPlanId, String phoneMd5) {
        return StringUtils.format("{}_{}_{}", productId, productPlanId, phoneMd5);
    }
}
